<?php

namespace app\supply\controller;
use app\common\controller\PCBase;
use app\supply\logic\SupplyContactLogic;
use Throwable;
use app\common\library\Upload;
use  think\App;
class SupplyContact  extends PCBase
{

    /**
     * 查看列表
     * @date    2024/12/8
     * @throws Throwable
     */
    public function index()
    {

        $params   = $this->request->post();
        return  (new SupplyContactLogic())->getList($params);
    }

    /**
     * @desc    采购条码详情
     * @date    2024/12/8
     * @author  zhangheng
     */
    public function info(){
        $params     = $this->request->post();
        return  (new SupplyContactLogic())->get_info($params);
    }

    /**
     * @desc   采购码数据导入
     * @author zhangheng
     * @date   2024-12-06
     */
    public function importInfo(){
        $adminId    = $this->getAdminId();
        $file       = $this->request->file('file');
        $res        = (new Upload($file))->upload(null, $this->getAdminId()); 
        return  (new SupplyContactLogic())->import($res['url'],$adminId);
    }

    /**
     * @desc    下载模板
     * @date    2024/12/8
     * @author  zhangheng
     */
    public function export(){

        $params     = $this->request->post();
        return  (new SupplyContactLogic())->export($params);
    }
    
    /**
     * @desc    修改打印状态
     * @date    2024/12/10
     * @author  zhangheng
     */
    public function resert_status(){

        $params     = $this->request->post();
        return  (new SupplyContactLogic())->resert_status($params);
    }


    /**
     * @desc    修改打印状态
     * @date    2024/12/10
     * @author  zhangheng
     */
    public function add_remark(){

        $params     = $this->request->post();
        return  (new SupplyContactLogic())->add_remark($params);
    }


    /**
     * @desc    修改打印状态
     * @date    2024/12/10
     * @author  zhangheng
     */
    public function change_status(){

        $params     = $this->request->post();
        return  (new SupplyContactLogic())->change_status($params);
    }



}